﻿<%@ Page Language="C#" MasterPageFile="~/webUI/user/userTemplate.master" AutoEventWireup="true"
    CodeFile="product_ticket.aspx.cs" Inherits="product_ticket" Title=".::E-Valuation System::.." %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:Panel ID="Panel6" runat="server">
        <div class="THIO_Wizard" style="float: left;">
            <label>
                Trước khi nhập điểm bạn phải chọn một số mục</label>
            <div class="FeildContainer">
                <label>
                    Chọn hội đồng</label>
                <asp:DropDownList CssClass="Select" runat="server" DataSourceID="hoidongData" ID="cb_hoidong"
                    DataTextField="TenHoidong" DataValueField="MaHoidong" AutoPostBack="true" OnSelectedIndexChanged="changeCucil">
                </asp:DropDownList>
                <asp:SqlDataSource runat="server" ID="hoidongData" ConnectionString="<%$ ConnectionStrings:evaConn %>"
                    SelectCommand="SELECT [MaHoidong], [TenHoidong] FROM [hoidong] where madoanhnghiep=@madoanhnghiep union select 0, N'----Chọn một----'">
                    <SelectParameters>
                        <asp:SessionParameter SessionField="companyId" Name="madoanhnghiep" />
                    </SelectParameters>
                </asp:SqlDataSource>
            </div>
            <div class="FeildContainer">
                <label>
                    Chọn thành viên</label>
                <asp:DropDownList CssClass="Select" runat="server" ID="cb_thanhvien" DataSourceID="thanhvienData"
                    DataTextField="tenthanhvien" DataValueField="mathanhvien" AutoPostBack="true"
                    OnSelectedIndexChanged="changeMember">
                </asp:DropDownList>
                <asp:SqlDataSource runat="server" ID="thanhvienData" ConnectionString="<%$ ConnectionStrings:evaConn %>"
                    SelectCommand="Select ThanhVien.MaThanhVien,TenThanhVien From ThanhVien inner join HoiDongChamDiem  on ThanhVien.MaThanhVien=HoiDongChamDiem.MathanhVien where ThanhVien.Status=1 and MahoiDong=@mahoidong and HoiDongChamDiem.Status=1 ">
                    <SelectParameters>
                        <asp:ControlParameter Name="mahoidong" ControlID="cb_hoidong" PropertyName="SelectedValue" />
                        <asp:SessionParameter Name="madoanhnghiep" SessionField="companyId" />
                    </SelectParameters>
                </asp:SqlDataSource>
            </div>
            <div class="FeildContainer">
                <label>
                    Chọn sản phẩm</label>
                <asp:DropDownList CssClass="Select" runat="server" ID="cb_sanpham" DataSourceID="sanphamData"
                    DataTextField="TenSanPham" DataValueField="MaSanPham" AutoPostBack="true" OnSelectedIndexChanged="changeProduct">
                </asp:DropDownList>
                <asp:SqlDataSource runat="server" ID="sanphamData" ConnectionString="<%$ ConnectionStrings:evaConn %>"
                    SelectCommand="SELECT [MaSanPham], [TenSanPham] FROM [SanPham] where mahoidong=@mahoidong and madoanhnghiep=@madoanhnghiep and status =1">
                    <SelectParameters>
                        <asp:ControlParameter Name="mahoidong" ControlID="cb_hoidong" PropertyName="SelectedValue" />
                        <asp:SessionParameter Name="madoanhnghiep" SessionField="companyId" />
                    </SelectParameters>
                </asp:SqlDataSource>
            </div>
        </div>
    </asp:Panel>
    <asp:Panel ID="PanelNhapdiem" runat="server">
        <div class="UIDivInfo">
            <div class="UITabPane" style="margin-top: 15px;">
                <div class="TabPaneContent">
                    <div class="WorkingAreaWithHelp" style="width: 98.5%;">
                        <div class="UIHorizontalTabs">
                            <div class="LeftHorizontalTabs">
                                <div class="RightHorizontalTabs">
                                    <div class="CenterHorizontalTabs">
                                        <div class="TabsContainer">
                                            <asp:PlaceHolder ID="TabsContainer" runat="server">
                                                <div class="UITab NormalTabStyle">
                                                    <% String className = "NormalTab";
                                                       if (getSelectedTab().Equals("0"))
                                                       {
                                                           className = "SelectedTab";
                                                       }
                                                    %>
                                                    <div id="UITab0" class="<%=className %>">
                                                        <div class="LeftTab">
                                                            <div class="RightTab">
                                                                <div class="MiddleTab">
                                                                    <asp:LinkButton CssClass="NormalLink" ID="TabValue0" runat="server" CausesValidation="false"
                                                                        OnClick="ChangeTabIndex">
                                                                  Điểm sản phẩm
                                                                    </asp:LinkButton>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="UITab NormalTabStyle">
                                                    <%
                                                        className = "NormalTab";
                                                        if (getSelectedTab().Equals("1"))
                                                        {
                                                            className = "SelectedTab";
                                                        }
                                                    %>
                                                    <div id="UITab1" class="<%=className %>">
                                                        <div class="LeftTab">
                                                            <div class="RightTab">
                                                                <div class="MiddleTab">
                                                                    <asp:LinkButton CssClass="NormalLink" ID="TabValue1" runat="server" CausesValidation="false"
                                                                        OnClick="ChangeTabIndex" ToolTip="Sản phẩm theo công đoạn sản xuất">
                                                                Sp theo công đoạn sản xuất
                                                                    </asp:LinkButton>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="UITab NormalTabStyle">
                                                    <%
                                                        className = "NormalTab";
                                                        if (getSelectedTab().Equals("2"))
                                                        {
                                                            className = "SelectedTab";
                                                        }
                                                    %>
                                                    <div id="UITab2" class="<%=className %>">
                                                        <div class="LeftTab">
                                                            <div class="RightTab">
                                                                <div class="MiddleTab">
                                                                    <asp:LinkButton CssClass="NormalLink" ID="TabValue2" runat="server" CausesValidation="false"
                                                                        OnClick="ChangeTabIndex" ToolTip=" Giá trị còn lại của thiết bị">
                                                                  Giá trị còn lại của TB
                                                                    </asp:LinkButton>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </asp:PlaceHolder>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div style="clear: left;">
                            <span></span>
                        </div>
                        <asp:PlaceHolder ID="UITabContentContainer" runat="server">
                            <div class="UITabContentContainer">
                                <div class="THIO_Wizard">
                                    <%
                                        String styleDisplay = "none";
                                        if (getSelectedTab().Equals("0"))
                                        {
                                            styleDisplay = "block";
                                        }
                                    %>
                                    <div id="UITabContent0" class="UITabContent" style="display: <%=styleDisplay %>">
                                        <asp:Panel ID="Panel1" runat="server">
                                            <div class="GridViews">
                                                <table>
                                                    <tr>
                                                        <td><asp:GridView ID="diemsanphamView" AutoGenerateColumns="false" runat="server" DataKeyNames="maso">
                                                                <Columns>
                                                                    <asp:BoundField DataField="maso" Visible="false" />
                                                                    <asp:TemplateField HeaderText="Nội dung cho điểm">
                                                                        <ItemTemplate>
                                                                            <asp:Label ID="Label1" runat="server" Text='<%#Eval("noidung")%>'></asp:Label>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="Hệ số trọng lượng">
                                                                        <ItemTemplate>
                                                                            <asp:TextBox ID="TextBox1" CssClass="GridTextBox" runat="server" Text='<%#Eval("diem")%>'></asp:TextBox>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="Điểm gốc">
                                                                        <ItemTemplate>
                                                                            <asp:TextBox ID="TextBox3" runat="server" CssClass="GridTextBox" Text='<%#Eval("diemgoc")%>'></asp:TextBox>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="Tổng số">
                                                                        <ItemTemplate>
                                                                            <asp:TextBox ID="TextBox4" CssClass="GridTextBox" runat="server" Text='<%#Eval("tongso")%>'></asp:TextBox>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                </Columns>
                                                            </asp:GridView>
                                                            
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <div runat="server" id="diemsanphamGridInfo" class="GridInfo">
                                                                <label>
                                                                    Chưa có dữ liệu</label>
                                                            </div>
                                                            <div runat="server" id="diemsanphamGridTotal" class="GridTotal">
                                                                <label>
                                                                    Tổng điểm</label>
                                                                <asp:TextBox runat="server" ID="TotalProdutTicket">
                                                                </asp:TextBox>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </div>
                                        </asp:Panel>
                                    </div>
                                    <%
                                        styleDisplay = "none";
                                        if (getSelectedTab().Equals("1"))
                                        {
                                            styleDisplay = "block";
                                        }
                                    %>
                                    <div id="UITabContent1" class="UITabContent" style="display: <%=styleDisplay %>">
                                        <asp:Panel runat="server" ID="CapPhepPanle">
                                        <div class="GridViews">
                                                <table>
                                                    <tr>
                                                        <td>
                                                        <!--Phieu diem theo cong doan SX-->
                                                            <asp:GridView ID="PhieuDiemTheoCongDoanSX_GrdView" AutoGenerateColumns="false"  runat="server" DataKeyNames="maso">
                                                                <Columns>
                                                                    <asp:BoundField DataField="maso" Visible="false" />
                                                                    <asp:TemplateField HeaderText="Các chỉ tiêu kỹ thuật">
                                                                        <ItemTemplate>
                                                                            <asp:Label ID="Label2" runat="server" Text='<%#Eval("cacchitieuKT")%>'></asp:Label>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="label">
                                                                     <ItemTemplate>
                                                                       
                                                                     </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="Tamax">
                                                                        <ItemTemplate>
                                                                            <asp:TextBox ID="TextBox5" CssClass="GridTextBox" runat="server" Text='<%#Eval("diemMAX")%>' ReadOnly="true"></asp:TextBox>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="Tamin">
                                                                        <ItemTemplate>
                                                                            <asp:TextBox ID="TextBox6" runat="server"  CssClass="GridTextBox" Text='<%#Eval("diemMIN")%>' ReadOnly="true" ></asp:TextBox>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                    <asp:TemplateField HeaderText="Theo tiêu chuẩn điểm">
                                                                        <ItemTemplate>
                                                                            <asp:TextBox ID="TextBox7"  TextMode="MultiLine" CssClass="TextArea"  runat="server" Text='<%#Eval("Tieuchuandiem")%>' ReadOnly = "true" ></asp:TextBox>
                                                                        </ItemTemplate>
                                                                    </asp:TemplateField>
                                                                </Columns>
                                                            </asp:GridView>
                                                        </td>
                                                    </tr>                                                                                                        
                                                </table>
                                            </div>
                                        </asp:Panel>
                                    </div>
                                    <%
                                        styleDisplay = "none";
                                        if (getSelectedTab().Equals("2"))
                                        {
                                            styleDisplay = "block";
                                        }
                                    %>
                                    <div id="UITabContent2" class="UITabContent" style="display: <%=styleDisplay %>;">
                                        <asp:Panel ID="Panel7" runat="server">
                                         <div class="ToolArea">
                                          
                                          <div class="ToolLeftMenu">
                                            <asp:DropDownList ID="cb_toolDataView" CssClass="SelectRes" AutoPostBack="true" OnSelectedIndexChanged="cb_toolDataViewChanged" runat="server" DataTextField="tenthietbi" DataValueField="mathietbi" DataSourceID="toolData"></asp:DropDownList>
                                            <asp:SqlDataSource ID="toolData" runat="server"
                                             ConnectionString ="<%$ConnectionStrings:evaConn %>" SelectCommand="select mathietbi, tenthietbi from thietbi where madoanhnghiep=@madoanhnghiep"
                                            >
                                            <SelectParameters>
                                             <asp:SessionParameter  Name="madoanhnghiep" SessionField="companyId"/>
                                            </SelectParameters>
                                            </asp:SqlDataSource>
                                            <asp:Repeater runat="server" DataSourceID="mathietbiFilter"  >
                                             <ItemTemplate>
                                             <div class="FieldContainer">
                                             <label>Năm sản xuất</label>
                                             <label><%#Eval("namsanxuat") %></label>
                                            </div>
                                            
                                            <div class="FieldContainer">
                                             <label>Nơi sản xuất</label>
                                             <label><%#Eval("noisanxuat") %></label>
                                            </div>
                                             <div class="FieldContainer">
                                              <img  width="100 " height="100 " alt="<%#Eval("tenthietbi") %>" src="<%#Eval("myimage") %>" />
                                             </div>
                                             </ItemTemplate>
                                            </asp:Repeater>
                                            <asp:SqlDataSource ID="mathietbiFilter" runat="server"
                                             ConnectionString ="<%$ConnectionStrings:evaConn %>" SelectCommand="select * from thietbi inner join lachau on 
                                             thietbi.lachau = lachau.lachau where madoanhnghiep=@madoanhnghiep
                                             and mathietbi=@mathietbi
                                             "
                                            >
                                            <SelectParameters>
                                             <asp:SessionParameter  Name="madoanhnghiep" SessionField="companyId"/>
                                             <asp:ControlParameter Name="mathietbi" ControlID="cb_toolDataView" PropertyName="SelectedValue" />
                                            </SelectParameters>
                                            </asp:SqlDataSource>
                                          </div>
                                          <div class="ToolRightMenu">
                                              <asp:Repeater  runat="server" DataSourceID="mathietbiFilter"  >
                                              <ItemTemplate>
                                               <div class="FieldContainer">
                                                 <label>Lạc hậu về đời T%</label>
                                                 <asp:TextBox CssClass="TextboxRes" runat="server" Text='<%#Eval("T") %>'></asp:TextBox>  %
                                                </div>
                                                
                                                 <div class="FieldContainer">
                                                 <label>Hao mòn hữu hình H%</label>
                                                 <asp:TextBox  CssClass="TextboxRes" runat="server" Text='<%#Eval("H") %>'></asp:TextBox>  %
                                                </div>
                                                
                                                <div class="FieldContainer">
                                                 <label>Năng suất thực tế N%</label>
                                                 <asp:TextBox    CssClass="TextboxRes" runat="server" Text='<%#Eval("N") %>'></asp:TextBox>  %
                                                </div>
                                                
                                                <div class="FieldContainer">
                                                 <label>Chất lượng C%</label>
                                                 <asp:TextBox     CssClass="TextboxRes" runat="server" Text='<%#Eval("C") %>'></asp:TextBox>  %
                                                </div>
                                                
                                                 <div class="FieldContainer">
                                                 <label>Chất lượng C%</label>
                                                 <asp:TextBox ID="TextBox2"    CssClass="TextboxRes" runat="server" Text='<%#Eval("C") %>'></asp:TextBox>  %
                                                </div>
                                                
                                                
                                                 <div class="FieldContainer">
                                                 <label>k (k nằm trong khoảng từ 0 đến 1) </label>
                                                 <asp:TextBox     CssClass="TextboxRes" runat="server" Text='<%#Eval("K") %>'></asp:TextBox>  %
                                                </div>
                                                
                                                
                                                 <div class="FieldContainer">
                                                 <label>kT (kT là hệ số ảnh hưởng) </label>
                                                 <asp:TextBox      CssClass="TextboxRes" runat="server" Text='<%#Eval("KT") %>'></asp:TextBox>  %
                                                </div>
                                                
                                                 <div class="FieldContainer">
                                                 <label>kH (kHlà hệ số ảnh hưởng)</label>
                                                 <asp:TextBox     CssClass="TextboxRes" runat="server" Text='<%#Eval("KH") %>'></asp:TextBox>  %
                                                </div>
                                                
                                                 <div class="FieldContainer">
                                                 <label>kN (kNlà hệ số ảnh hưởng)</label>
                                                 <asp:TextBox    CssClass="TextboxRes" runat="server" Text='<%#Eval("KN") %>'></asp:TextBox>  %
                                                </div>
                                                
                                                <div class="FieldContainer">
                                                 <label>kC (kClà hệ số ảnh hưởng)</label>
                                                 <asp:TextBox     CssClass="TextboxRes" runat="server" Text='<%#Eval("KC") %>'></asp:TextBox>  %
                                                </div
                                                
                                                </ItemTemplate>
                                              </asp:Repeater>
                                          
                                         
                                          </div>
                                          <div class="ClearLeft"><span></span></div>
                                         </div>
                                         
                                        </asp:Panel>
                                    </div>
                                    
                                </div>
                            </div>
                        </asp:PlaceHolder>
                    </div>
                </div>
            </div>
        </div>
       <div class="ActionButtons">
    <%if( getSelectedTab() != "0" ) { %>
        <asp:Button runat="server" ID="btn_back" Text="Quay lại" OnClick="backStep" />
     <%} %>
     <%if( getSelectedTab() != "2" ) { %>
        <asp:Button runat="server" ID="btn_next" Text="Tiếp" OnClick="nextStep" />
         
      <%} %>
        <asp:Button runat="server" ID="btn_reset" Text="Nạp lại" OnClick="resetValue" />
        <asp:Button runat="server" ID="btn_finish" Text="Kết thúc" OnClick="saveWizard" />
        <asp:Button runat="server" ID="btn_cancel" Text="Bỏ qua" OnClick="cancelWizard" />
    </div>
    </asp:Panel>
</asp:Content>
